home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sounds Terrific 1
/
Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso
/
modules
/
t
/
td-arjad.mod
< prev
next >
Wrap
Text File
|
1994-08-04
|
11KB
|
301 lines
TJ-ARJAD.MOD.....Revision of TESTUL13 by Cpt Learjet.
Trader Jack #1 @8315
1Wednesday, 3January 71, 51992 2 4:43 pm 2<3EST2>
3[7Msg Status3]7:1 Replies 6Wanted
┌────────────────────────────────────────────────────────────────────────────┐
│ Mod Name: TJ-ARJAD.MOD Mod Author: Captain Learjet 1@8755 │
│ Revision by: Trader Jack 1@8315 │
│ Difficulty: Easy Date: 01-01-91 │
│ WWIV Version: 4.12+ with TESTUL13.MOD installed. Should work on 4.2x. │
│ Description: Adds the ARJ Compression Protocol to Captain Learjet's │
│ Test Upload 1.3 Mod. │
└────────────────────────────────────────────────────────────────────────────┘
Firstly, I take no credit for this code. All that I did was take
Captain Learjet's mod and add in a few lines. I am including the entire mod
in case you do not have TESTUL13.MOD installed. If you already have it in, all
you need do is add the lines that are commented /*TJ-ARJAD*/ and you'll be set.
The colors I use are my preferences and you may want to change them. Please
remember that the ^P^C # are literal for Borland C++ and Turbo C++.
Insert your favorite disclaimer here.
If I need to tell you to back up your source, you don't need to be modding.
Here goes....
<< Step one: >>
Load FCNS.H (bleck!) and add the following four functions at the
bottom of XFER.C: (This step is optional, and was not done in the original mod.
If you put the functions right at the very begining of XFER.C, all should be
well. The way I understand it, it is just the proper way to do it.)
void test_upload(int l, int sysop, char *s); /*TJ-ARJAD*/
void test_arc(); /*TJ-ARJAD*/
void add_comment(); /*TJ-ARJAD*/
void check_for_virus(); /*TJ-ARJAD*/
<< Step two: >>
Load BBS.C and do this in void dlmainmenu() :
if (strcmp(s,"/O")==0)
hangup=1;
if ((strcmp(s,"/?")==0) && (dcs())) /* <-- Search for this. */
printmenu(8);
if (strcmp(s,"/T")==0) /* ADD */
test_arc(); /* ADD */
if (strcmp(s,"/V")==0) /* ADD */
check_for_virus(); /* ADD */
if ((strcmp(s,"/K")==0) && (dcs())) /* ADD */
add_comment(); /* ADD */
if ((strcmp(s,"UPLOADALL")==0) && (dcs())) { /* original code */
Save BBS.C
<< Step three: >>
Load XFER.C and add the following FOUR functions near the top
of the file:
void test_upload(int l, int sysop, char *s)
{
char s1[81],s2[81],s3[81];
int i,i1,type,abort,next;
uploadsrec u;
type=abort=next=0;
if (l) {
align(s);
dliscan();
}
i=recno(s);
do {
if (i>0) {
SETREC(i);
read(dlf,(void *)&u,sizeof(uploadsrec));
if (l==0 || l==1) {
if ((compare(u.filename,"????????.ARC")) ||
(compare(u.filename,"????????.LZH")) ||
(compare(u.filename,"????????.PAK")) ||
(compare(u.filename,"????????.ARJ")) || /*TJ-ARJAD*/
(compare(u.filename,"????????.ZIP"))) {
if (!sysop)
sprintf(s1,"%s%s",directories[udir[curdir].subnum].path,
stripfn(u.filename));
else
sprintf(s1,"%s%s",directories[0].path,stripfn(u.filename));
if (exist(s1)) {
ansic(2);
print("Testing archive integrity of ",u.filename,":","");
nl();
if (strstr(u.filename,".ARC"))
sprintf(s2,"PKUNPAK -T %s",s1);
if (strstr(u.filename,".LZH"))
sprintf(s2,"LHARC T %s",s1);
if (strstr(u.filename,".PAK"))
sprintf(s2,"PAK T %s",s1);
if (strstr(u.filename,".ARJ")) /*TJ-ARJAD*/
sprintf(s2,"ARJ T %s",s1); /*TJ-ARJAD*/
if (strstr(u.filename,".ZIP"))
sprintf(s2,"PKUNZIP -T %s",s1);
i1=run_external1(s2);
prt(2,u.filename);
if (i1) {
pl(" ^P^C6 \7FAILED\7 ^P^C2 the archive test!");
nl();
sprintf(s2,"^P^C2%s ^P^C6FAILED ^P^C2 an archive test. Please che
ck the file!",u.filename);
ssm(1,0,s2);
sysoplog(s2);
if (l)
closedl();
return;
} else {
prt(5," PASSED ^P^C2 the archive test.");nl();
}
}
checka(&abort,&next);
}
}
if (l==0 || l==2) {
if ((compare(u.filename,"????????.ARC")) ||
(compare(u.filename,"????????.LZH")) ||
(compare(u.filename,"????????.PAK")) ||
(compare(u.filename,"????????.ARJ")) || /*TJ-ARJAD*/
(compare(u.filename,"????????.ZIP")))
type=1;
if ((compare(u.filename,"????????.EXE")) ||
(compare(u.filename,"????????.COM")))
type=2;
if (type) {
if (!sysop)
sprintf(s1,"%s%s",directories[udir[curdir].subnum].path,
stripfn(u.filename));
else
sprintf(s1,"%s%s",directories[0].path,stripfn(u.filename));
if (exist(s1)) {
nl();
ansic(2);
print("Scanning ",u.filename," for viruses:","");
nl();
prt(3,"Please be patient...");nl();
if (type==1) {
if (strstr(u.filename,".ARC"))
sprintf(s2,"PKUNPAK %s %s",s1,syscfg.tempdir);
if (strstr(u.filename,".LZH"))
sprintf(s2,"LHARC X %s %s",s1,syscfg.tempdir);
if (strstr(u.filename,".PAK"))
sprintf(s2,"PAK E %s %s",s1,syscfg.tempdir);
if (strstr(u.filename,".ARJ")) /*TJ-ARJAD*/
sprintf(s2,"ARJ E %s %s",s1,syscfg.tempdir); /*TJ-ARJAD*/
if (strstr(u.filename,".ZIP"))
sprintf(s2,"PKUNZIP %s %s",s1,syscfg.tempdir);
run_external(s2);
sprintf(s3,"SCAN /nomem %s*.*",syscfg.tempdir);
i1=run_external1(s3);
remove_from_temp("*.*",0);
} else {
sprintf(s2,"SCAN /nomem %s",s1),
i1=run_external1(s2);
}
prt(2,u.filename);
if (i1==1) {
pl(" ^P^C6 \7FAILED\7 ^P^C2 the virus test! ^P^C0");
nl();
sprintf(s2,"%s FAILED the virus test. Please delete the file!",
u.filename);
ssm(1,0,s2);
sysoplog(s2);
if (l)
closedl();
return;
} else {
pl(" ^P^C5PASSED ^P^C2 the virus test. ^P^C0");
nl();
}
}
checka(&abort,&next);
}
}
if (l==0 || l==3) {
if (compare(u.filename,"????????.ZIP")) {
sprintf(s3,"Adding comment to %s",u.filename);
prt(2,s3);nl();
if (!sysop)
sprintf(s1,"PKZIP -z %s%s < %sCOMMENT.TXT",
directories[udir[curdir].subnum].path,stripfn(u.filename),
syscfg.gfilesdir);
else
sprintf(s1,"PKZIP -z %s%s < %sCOMMENT.TXT",
directories[0].path,stripfn(u.filename),syscfg.gfilesdir);
run_external(s1);
}
checka(&abort,&next);
}
}
i=nrecno(s,i);
} while ((i>0) && (!hangup) && (!abort));
if (l)
closedl();
}
void test_arc()
{
char s[81];
nl();
prt(2,"Archive to Test: ");
mpl(12);
input(s,12);
if (strchr(s,'.')==NULL)
strcat(s,".*");
test_upload(1,0,s);
topscreen();
}
void check_for_virus()
{
char s[81];
nl();
prt(2,"Archive to Scan: ");
mpl(12);
input(s,12);
if (strchr(s,'.')==NULL)
strcat(s,".*");
test_upload(2,0,s);
topscreen();
}
void add_comment()
{
char s[81];
nl();
prt(2,"Add Comment to: ");
mpl(12);
input(s,12);
if (strchr(s,'.')==NULL)
strcat(s,".*");
test_upload(3,0,s);
topscreen();
}
<< Step four: >>
In the function void upload(int dn) add this stuff:
sprintf(s,"+%s uploaded on %s",u.filename,directories[dn].name);
sysoplog(s); /* search for the above line */
if (!incom) { /* ADD */
nl(); /* ADD */
prt(5,"Test the File? "); /* ADD */
if (yn()) /* ADD */
test_upload(0,0,u.filename); /* ADD */
} else { /* ADD */
if (!dn) /* ADD */
test_upload(0,1,u.filename); /* ADD */
else /* ADD */
test_upload(0,0,u.filename); /* ADD */
} /* ADD */
nl();
pl("File uploaded."); /* Original code continues */
Save XFER.C
<< Step four: >>
If you're in the IDE, punch F-9 and let 'er fly. Go get a beer at the local
bar if you have an 8088, because the whole thing has to be re-compiled.
If you use the MAKEFILE, I hope you know what to do because I don't! I use
Borland C++ IDE.
<< Notes: >>
If you are currently using Test Upload 1.2 or before, you must replace
all the functions with the new ones. The new functions are more portable.
You no longer have to hard code your temporary directory into the function.
You must now have your COMMENT.TXT file in your GFILES directory.
You must have SCAN, PKUNPAK, LHarc, PAK, PKZIP PKUNZIP and ARJ in your
WWIV directory. If you don't have all of these get them. Or if you don't
allow uploads of all types of archives, edit this file accordingly.
Once again, I take no credit for the TESTUL13.MOD, just the additions. If
you use this mod, PLEASE drop me a note so I know SOMEONE is using it. If
you have any problems, please contact me at:
-1=7<3*2Trader Jack 13@283153*7>1=0-
2===============================================================================
Origin: 583150 5 2T7he 2T7rading 2P7ost 2BBS0 2 3803-787-97830 3 1USR DS0 1 4WOMR0able 2SNARF0able